package com.april.pattern.creational.singleton;

/**
 * @author April
 * @version V1.0.0
 * @date 2019/06/23 10:03
 * @description 静态内部类单例 双重检测锁式的解决方式二，基于类初始化的延迟加载解决方案
 */
public class StaticInnerClassSingleton {
    private static class InnerClass {
        private static StaticInnerClassSingleton staticInnerClassSingleton = new StaticInnerClassSingleton();
    }

    private StaticInnerClassSingleton() {

    }

    public static StaticInnerClassSingleton getInstance() {
        return InnerClass.staticInnerClassSingleton;
    }
}
